/**
 * 
 */
package toutiao;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author zhongfang
 *
 */
public class 头条校招 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int a[] = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = scanner.nextInt();
		}
		Arrays.sort(a);
		int addCount = 0;
		int i = 0;
		int curIndex = 1;
		while (i < n) {
			if (i < n - 1) {
				if (curIndex == 3) {// 差距可以不用管
					i++;
					curIndex = 1;
					continue;
				}
				int diff = a[i + 1] - a[i];
				if (curIndex == 1) {
					if (diff > 20) {// 补两个
						addCount += 2;
						i++;
						curIndex = 1;
					} else if (diff > 10) {// 补一个，取后面一个
						addCount++;
						i += 2;
						curIndex = 1;
					} else {// 不用补，取后面两个
						curIndex++;
						i++;
					}
				}else {
					if (diff > 10) {// 补一个
						addCount++;
						i ++;
						curIndex = 1;
					} else {// 不用补
						curIndex=1;
						i+=2;
					}
				}
			}else {
				if(curIndex<3){
					addCount+=(3-curIndex);
				}
				i++;
			}
		}
		System.out.println(addCount);
	}

}
